/**
 * @param {number} n
 * @return {boolean}
 */
var isUgly = function(n) {
  if(n == 0) return false;
  while(n % 5 == 0) {
    n /= 5;
  }
  while(n % 3 == 0) {
    n /= 3;
  }
  while(n % 2 == 0) {
    n /= 2;
  }
  if(n == 1) return true;
  return false;
};
let n = 6;
console.log(isUgly(n));
n = 1;
console.log(isUgly(n));
n = 14;
console.log(isUgly(n));
